"""
@name : 三创官网图片爬取
@author : FengZT_19
@projectname: python_consumer.py
"""
import requests
import re

url = "https://www.sanchuangedu.cn"
result = requests.get(url)
print(result.text)
imgs = re.findall(r"(?<=<img src=).*(?= width)", result.text)
print(imgs)

for i in imgs:
    # 请求图的二进制数据
    img = requests.get(url + '/' + i).content
    with open(f"./{i}", "wb") as fp:
        fp.write(img)
        print(i, "下载成功！")